import request from '../utils/request'

/**
 * 通用api
 */
class systemApi {
    //开始测评
    startTest(data) {return post('https://essay.shenqingquan.com/prod-api/aifront/ai/score', data)}

    //重试获取测评结果
    retryScore(data) {return request.post('https://essay.shenqingquan.com/prod-api/aifront/ai/retryscore', data)}
   //注册信息
    register(info) { return request.post('https://essay.shenqingquan.com/prod-api/aifront/user/register', info)}
    //保存文书信息
  savews(data) { return request.post('https://essay.shenqingquan.com/prod-api/aifront/user/saveAttach', data)}
    //获取vip套餐
  getVip(type) { return request.get(`https://essay.shenqingquan.com/prod-api/aifront/product/query?type=${type}`)}
    //下载文件
  downloadFile(params) { return request.get('https://essay.shenqingquan.com/prod-api/aifront/task/myattach', { params })}
    //支付是否成功
  isPayOk(params) { return request.get('https://essay.shenqingquan.com/prod-api/aifront/task/paysuccess?', { params})}

    save(data) {return postBody(`${data.class}/save`, data)}

    deleteById(data) {return post(`${data.class}/deleteById/${data.id}`)}

  exportList(data) { return post(`${data.class}/exportList`, data) }

  aliPay(params) {
    return request({
      url:'https://essay.shenqingquan.com/prod-api/aifront/pay/ali_web_pay' ,
      method: 'get',
      params
    })
  }
  wechatPay(params) {
    return request({
      url: 'https://essay.shenqingquan.com/prod-api/aifront/pay/wx_h5_pay',
      method: 'get',
      params
    })
  }

}

// 实例化后再导出
export default new systemApi()
